<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		if("${requestScope.letter.letterBackGround}"!="clean"){
			$("#page").css("background-image","url(${initParam.root}/letter/${requestScope.letter.letterBackGround})");
		}
		$("#listBtn").click(function(){
			//list버튼을 눌렀을 때 보던 페이지의 그룹의 목록을 띄우기 위해 param.pageNo로 본던페이지의 pageNo를 가져옴.
			location.href="letter.do?command=letterList&pageNo=${param.pageNo}";
		});
		$("#updateBtn").click(function(){
			if(confirm("수정하시겠습니까?")){
				location.href="letter.do?command=updateLetterForm&letterNo=${requestScope.letter.letterNo}";
			}
		});
		$("#deleteBtn").click(function(){
			if(confirm("삭제하시겠습니까?")){
				location.href="letter.do?command=deleteLetter&letterNo=${requestScope.letter.letterNo}";
			}
		});
	});
</script>
<table align="center">
	<tr>
	<td height="10"><font size="2"><b>제목 : ${requestScope.letter.letterTitle}</b></font></td>
	</tr>
	<tr>
	<td id="page" width="450" height="500" style="padding: 15px"><pre>${requestScope.letter.letterContent}</pre></td>
	</tr>
</table>
<br>

<span style="margin-left: 350px;">
<img src="${initParam.root}/img/list_btn.gif" id="listBtn">&nbsp;</span>
<c:if test="${requestScope.letter.mvo.id==sessionScope.mvo.id}">
<img src="${initParam.root}/img/update_btn.gif" id="updateBtn">&nbsp;
<img src="${initParam.root}/img/delete_btn.gif" id="deleteBtn">
</c:if>

